﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Mobile.Models.ArticleListViewModel>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<div class="a_top">
    <div class="tit_bg">
        <span class="tit_name">
        <%=Html.CustomActionLink(ViewData["Title"].ToString(), Model.Category != null ? Model.Category.Name : "tin tức", "article", "index", new Dictionary<string, object>() { { "id",Model.Category!=null? Model.Category.ID:0 } }, true, string.Empty, false)%>
        </span>
    </div>
    <div class="d_top">
        <table class="tablelist" width="100%">
        <%foreach (var item in Model.Articles)
          {
              var root = SDT.Model.ArticleManager.GetDefaultImageUrl(item.ArticleCategory.ID);
              string imgPath = root != string.Empty ? root : ((item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 61, 52, item.ImagePath, Model.ImagePath, Model.RootImageUrl) : SDT.Lib.Common.Globals.DefaultLogo); 
          %>
           <tr>
           <td width="65px">
               <div class="tit_img">
                <%=Html.CustomActionImage(item.Title, item.ArticleCategory.Name, Model.ControllerName, Model.ActionDetails, new Dictionary<string, object>() { { "id", item.ID } }, "bor_img", string.Empty, 61, 51, imgPath)%>
               </div>
           </td>
           <td>
               <div class="tit_cnt">
                <div>
                    <%=Html.CustomActionLink(item.Title, item.ArticleCategory.Name, "article", "details", new Dictionary<string, object>() { { "id", item.ID } }, true, "l_blue")%>
                </div>
                <div class="datetime">
                    <%=item.AddDate != null ? (SDT.Lib.Common.Utils.ToDayOfWeekLabel(item.AddDate) + ", " + string.Format("{0:dd/MM/yyyy, hh:mm tt}", item.AddDate)) : string.Empty%>
                </div>
                <div>
                    <%=Html.Encode(item.Summary)%>
                </div>
               </div>
               <div class="clear"></div>
           </td>
           
           </tr>
        <%} %>
        </table>
    </div>
</div>
      


